<template>
    <div>
      <el-button type="primary"  @click="finaByArea('A')">A区域</el-button>
      <el-button type="primary"  @click="finaByArea('B')">B区域</el-button>
      <el-button type="primary"  @click="finaByArea('C')">C区域</el-button>
      <el-button type="primary"  @click="finaByArea('D')">D区域</el-button>
      <div id="div1">
        <el-table :data="ProductList" stripe style="width: 100%">
          <el-table-column prop="pName" label="物资名称" width="180"></el-table-column>
        </el-table>
      </div>
    </div>
</template>
<script>
export default {
  name: 'Area',
  data () {
    return {
      ProductList: []
    }
  },
  methods: {
    async finaByArea (areass) {
      const { data: res } = await this.$http.get('area/findByArea/' + areass)
      console.log(areass)
      if (res.code !== 200) {
        return this.$message.error(res.msg)
      }
      this.ProductList = res.data
      console.log(res.data)
    }
  }
}
</script>

<style scoped>

</style>
